﻿/**
 * @file viewdatacontroller.cpp
 * @author huangxb
 * @email 18228033207@163.com
 * @date 2024.04.24
 * @license MIT License
 * @brief 视图控制器.
 *
 * @htmlonly
 * <span style="font-weight: bold">History</span>
 * @endhtmlonly
 * Version|Auther|Date|Describe
 * ------|----|------|--------
 * V1.0|huangxb|2024.04.24|创建
 */

/* 自定义头文件 */
#include "viewdatacontroller.h"
#include "viewdatarefnodeview.h"

CViewDataController::CViewDataController()
{

}

CViewDataController::~CViewDataController()
{

}

void CViewDataController::SetViewImpl(CViewDataRefNodeView *pViewImpl)
{
    if(pViewImpl)
    {
        m_pViewImpl = pViewImpl;
        m_pViewImpl->SetViewDataController(this);
    }
}

CViewDataRefNodeView *CViewDataController::GetViewImpl() const
{
    return m_pViewImpl;
}

void CViewDataController::SetAdapter(CViewDataRefNodeAdapter *pViewDataRefNodeAdapter)
{
    if(pViewDataRefNodeAdapter)
    {
        m_pViewDataRefNodeAdapter = pViewDataRefNodeAdapter;
    }
}

CViewDataRefNodeAdapter *CViewDataController::GetAdapter() const
{
    return m_pViewDataRefNodeAdapter;
}

void CViewDataController::Show()
{
    if(m_pViewImpl)
    {
        m_pViewImpl->OnViewDataRefNodeLoaded();
    }
}
